package com.ym.medical.dao;

import com.ym.medical.domain.entity.DoctorPhoneSettingEntity;
import com.ym.medical.domain.vo.PhoneAppointmentTimeVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 电话问诊规则Dao接口
 *
 * @author ym
 * @date 2020-09-14
 */
@Repository
public interface DoctorPhoneSettingDao extends Mapper<DoctorPhoneSettingEntity>{

    /***
     * 电话预约时间列表查询
     * @param docServId
     * @return
     */
    List<PhoneAppointmentTimeVo> getPhoneSets(Long docServId);

    /***
     * 医生设置的预约时间查询当天到周日的时间
     * @param doctServId
     * @param currentWeekValue
     * @return
     */
    List<PhoneAppointmentTimeVo> doctAppointmentTime(
            @Param("doctServId") Long doctServId,
            @Param("currentWeekValue") int currentWeekValue);

    /***
     * 改变医生是否 可预约状态预约
     * @param doctServId
     * @param week
     * @param hour
     */
    void updateNotFlag(
            @Param("doctServId") Long doctServId,
            @Param("week") String week,
            @Param("hour") String hour);

    /***
     * 查询该时间段是否已经预约
     * @param doctServId
     * @param week
     * @param hour
     * @return
     */
    DoctorPhoneSettingEntity selectReservationStatus(
            @Param("doctServId") Long doctServId,
            @Param("week") String week,
            @Param("hour") String hour);

    /***
     * 凌晨修改不可预约时间可预约
     */
    void updateNotFlagTrue();

    /***
     * 释放预约时间
     * @param docServId
     * @param week
     * @param hour
     */
    void freedTime(
            @Param("docServId") Long docServId,
            @Param("week") String week,
            @Param("hour") String hour);
}
